<template>
  <div class="header-content">
    <div class="l-content">
      <el-button icon="el-icon-menu" size="mini" @click="changeNav"></el-button>
      <el-breadcrumb separator="/" style="margin-left:20px">
        <el-breadcrumb-item v-for="item in tagsList" :key="item.name" :to="{ path: item.path}">{{item.label}}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="r-content">
      <el-dropdown>
        <span class="el-dropdown-link"><img src="../../assets/images/user.png" alt="" /></span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: '',
  methods: {
    changeNav() {
      this.$store.commit('CHANGE_COLLAPSE');
    },
  },
  computed:{
    ...mapState({
      tagsList:state=>state.nav.tagsList
    })
  },
  // mounted() {
  //   console.log(this.tagsList);
  // },
};
</script>
<style lang="less" scoped>
.header-content {
  height: 60px;
  padding: 0 20px 0;
  background-color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .text {
    color: #fff;
    margin-left: 10px;
    font-size: 14px;
  }
  .r-content {
    img {
      height: 40px;
      width: 40px;
      border-radius: 50%;
    }
  }
  .l-content{
    display: flex;
    align-items: center;
    /deep/.el-breadcrumb__item{
      .el-breadcrumb__inner{
        font-weight: normal;
        &.is-link{
          color: #666;
        }
      }
      &:last-child{
        color: #fff;
      }
    }
  }
}
</style>
